第九天主要學習的是console的運用。
何為console?
主要功能為:
console
The Console object provides access to the browser's debugging console (e.g. the Web Console in Firefox). The specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided.
Console.log()
輸出訊息到 Web Console。
console.log(obj1 [, obj2, ..., objN]);
console.log(msg [, subst1, ..., substN]);
console.warn(obj1 [, obj2, ..., objN]);
console.warn(msg [, subst1, ..., substN]);
console.error(obj1 [, obj2, ..., objN]);
console.error(msg [, subst1, ..., substN]);
console.exception(obj1 [, obj2, ..., objN]);
console.exception(msg [, subst1, ..., substN]);
console.info(obj1 [, obj2, ..., objN]);
console.info(msg [, subst1, ..., substN]);
console.assert(assertion, obj1 [, obj2, ..., objN]);
console.assert(assertion, msg [, subst1, ..., substN]);
console.dir(object);
console.groupCollapsed([label]);
console.count();
console.count();
console.time();
console